package com.hyl.crmclient.controller;

import com.hyl.crmclient.service.UserService;
import com.hyl.jpademo.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2022/6/6 10:04
 **/
@Controller
public class ThymeleafContoller {

	@Resource
	private UserService userService;

	@RequestMapping(value = "/todemo")
	public String demo( Model model){
		//System.out.println(usrName+" "+usrPassword);
		model.addAttribute("loginName", "hhh");
		model.addAttribute("age", 17);

		List<User> list = userService.findAll();
		model.addAttribute("userList",list);
		return "demo";
	}
}
